#ifndef CORE_ISOTROPIC_H
#define CORE_ISOTROPIC_H
#include "Material.h"
#include "Texture.h"
#include "Hitable.h"
namespace RayTracer
{
	class Isotropic : public Material {
	public:
		Isotropic(vec3 c) : albedo(std::make_shared<SolidTexture>(c)) {}
		Isotropic(std::shared_ptr<Texture> a) : albedo(a) {}

		virtual bool Scatter(
			const Ray& r_in, const HitRecord& rec, vec3& attenuation, Ray& scattered
		) const override {
			scattered = Ray(rec.position, RandomSphere());
			attenuation = albedo->value(rec.u, rec.v, rec.position);
			return true;
		}

	public:
		std::shared_ptr<Texture> albedo;
	};
}
#endif // !CORE_ISOTROPIC_H
